-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove some direct calls to local_def_id_to_hir_id on diagnostics #108915
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Silly question: why not feed Some(HirId::make_owner(def_id))
to opt_local_def_id_to_hir_id(def_id)
for RPITIT items?
The hir_owner
and hir_owner_nodes
will return None
anyway.
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
243606e
to
eed78d8
Compare
any opinion on this @compiler-errors ? |
Sure, try it. If you do that, can you try to find other places you've already modified to side-step the lack of HIR id and revert those, if there are any? Any calls that rely on |
The test failures are happening in https://github.com/rust-lang/rust/pull/108915/files#diff-885afd8bd7572095e2347dc7eabce51cde3f47e07841d705770d94e0fccf2479R408, @compiler-errors any clue?. I'm not sure why the hir_id may not be an expr now. |
Have force pushed to fix something that wasn't good but the Fs are still there and I don't see how 5cac678 makes things different. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make the maybe_body_id
into a LocalDefId
instead of a DefId
?
Also, you should be able to pull the commit "Make some report and emit errors take DefIds instead of BodyIds" into a separate PR and I can r+ that one after you've applied the feedback.
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs
Outdated
Show resolved
Hide resolved
Sorry, |
Getting 3 tests failures with the discussed commit, seems that we are losing some inference info for diagnostics ...
|
@compiler-errors removed from this PR what we've placed in #108945 and this doesn't need any of the previous PRs either, so, I've just left the last commit in here and it's ready to be reviewed. |
compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs
Outdated
Show resolved
Hide resolved
…using-hir-id, r=compiler-errors Make some report and emit errors take DefIds instead of BodyIds Breaking off from rust-lang#108915 r? `@compiler-errors`
57474ec
to
b7d74f4
Compare
@compiler-errors this b7d74f4 is the only meaningful commit in this PR. I think we could merge this as is or with more commits that fix that test case, but I think this is good and process as is. Maybe we want some kind of comment in the |
@compiler-errors, this one was already ready for a review :). |
@bors r+ rollup |
📌 Commit b7d74f4e7ac76627a6807933e1dc2cc93b49eda0 has been approved by It is now in the queue for this repository. |
b7d74f4
to
4824363
Compare
@bors r=compiler-errors Noticed that after |
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#108722 (Support for Fuchsia RISC-V target) - rust-lang#108880 (Remove tests/ui/impl-trait/in-trait/new-lowering-strategy in favor of using revisions on existing tests) - rust-lang#108909 (Fix object safety checks for new RPITITs) - rust-lang#108915 (Remove some direct calls to local_def_id_to_hir_id on diagnostics) - rust-lang#108923 (Make fns from other crates with RPITIT work for -Zlower-impl-trait-in-trait-to-assoc-ty) - rust-lang#109101 (Fall back to old metadata computation when type references errors) - rust-lang#109105 (Don't ICE for late-bound consts across `AnonConstBoundary`) - rust-lang#109110 (Don't codegen impossible to satisfy impls) - rust-lang#109116 (Emit diagnostic when calling methods on the unit type in method chains) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Was playing with
tests/ui/impl-trait/in-trait/default-body-with-rpit.rs
and was able to remove some ICEs. Still getting ...But I guess this is a little bit of progress anyway.
This one goes on top of #108700 and #108945
r? @compiler-errors